﻿<%@ Page Title="Stock Dealer Intranet - Supervisor" Language="C#" MasterPageFile="~/MasterPage/Master.Master" AutoEventWireup="true" CodeBehind="wFrmStockDealerIntranetSupervisor.aspx.cs" Inherits="Crosland.Automotriz.Web.Vehiculos.wFrmStockDealerIntranetSupervisor" %>
<%@ Register assembly="DevExpress.Web.v13.1, Version=13.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxEditors" tagprefix="dx" %>
<%@ Register assembly="DevExpress.Web.v13.1, Version=13.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxRoundPanel" tagprefix="dx" %>
<%@ Register assembly="DevExpress.Web.v13.1, Version=13.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPanel" tagprefix="dx" %>
<%@ Register assembly="DevExpress.Web.ASPxPivotGrid.v13.1, Version=13.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPivotGrid" tagprefix="dx" %>
<%@ Register assembly="DevExpress.Web.v13.1, Version=13.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPopupControl" tagprefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v13.1, Version=13.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dx" %>

<%@ Register assembly="DevExpress.Web.v13.1, Version=13.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxTabControl" tagprefix="dx" %>
<%@ Register assembly="DevExpress.Web.v13.1, Version=13.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxClasses" tagprefix="dx" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cphMain" runat="server">

 <script type="text/javascript">

     function ShowDrillDown(column) {
         if (column != null) {
             if (column < 3) {
                 var mainElement = PivotGrid.GetMainElement();
                 DrillDownWindow.ShowAtPos(ASPxClientUtils.GetAbsoluteX(mainElement), ASPxClientUtils.GetAbsoluteY(mainElement));
             }
         }
     }

     function MostrarAlerta() {
         popupErrores.Show();
     }               

</script>



    <input runat="server" id="ColumnIndex" type="hidden" enableviewstate="true" />
    <input runat="server" id="RowIndex" type="hidden" enableviewstate="true" />

    <div class="main-header" style="width:100%;">
        <div class="main-titulo" style="text-align: left">
            Venta Interna - Stock Dealer - Supervisor</div>
    </div>

                      <div style="padding: 10px">

<table width="100%">
                          <tr>
                              <td>
                                  <table width="100%">
                                      <tr>
                                          <td style="width: 33px">
                                              <asp:Label ID="Label1" runat="server" Text="Año:"></asp:Label>
                                          </td>
                                          <td style="width: 105px">

                                  <asp:DropDownList ID="cboAño" runat="server" Width="100px">
                                  </asp:DropDownList>
                                          </td>
                                          <td style="width: 33px">
                                              <asp:Label ID="Label2" runat="server" Text="Mes:"></asp:Label>
                                          </td>
                                          <td style="width: 105px">
                                  <asp:DropDownList ID="cboMes" runat="server" Width="100px" AutoPostBack="True" 
                                                  onselectedindexchanged="cboMes_SelectedIndexChanged">
                                      <asp:ListItem Value="1">Enero</asp:ListItem>
                                      <asp:ListItem Value="2">Febrero</asp:ListItem>
                                      <asp:ListItem Value="3">Marzo</asp:ListItem>
                                      <asp:ListItem Value="4">Abril</asp:ListItem>
                                      <asp:ListItem Value="5">Mayo</asp:ListItem>
                                      <asp:ListItem Value="6">Junio</asp:ListItem>
                                      <asp:ListItem Value="7">Julio</asp:ListItem>
                                      <asp:ListItem Value="8">Agosto</asp:ListItem>
                                      <asp:ListItem Value="9">Setiembre</asp:ListItem>
                                      <asp:ListItem Value="10">Octubre</asp:ListItem>
                                      <asp:ListItem Value="11">Noviembre</asp:ListItem>
                                      <asp:ListItem Value="12">Diciembre</asp:ListItem>
                                  </asp:DropDownList>

                                          </td>
                                          <td style="width: 45px">
                                              <asp:Label ID="Label3" runat="server" Text="Marca:"></asp:Label>
                                          </td>
                                          <td style="width: 105px">

                                  <asp:DropDownList ID="cboMarca" runat="server" Width="100px">
                                  </asp:DropDownList>
                                          </td>
                                          <td style="width: 69px">
                                              <asp:Label ID="Label4" runat="server" Text="Supervisor:"></asp:Label>
                                          </td>
                                          <td style="width: 204px">
                                  <asp:DropDownList ID="cboSupervisor" runat="server" Width="200px">
                                  </asp:DropDownList>
                                                                                  </td>
                                          <td style="width: 115px">
                                                                                  <dx:ASPxButton runat="server" 
                                      SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css" Text="Consultar" 
                                      CssPostfix="Office2010Blue" 
                                      CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" Width="100px" 
                                      ID="btnConsultar" OnClick="btnConsultar_Click">
<Image Url="~/Images/search.png"></Image>
</dx:ASPxButton>

                                          </td>
                                          <td style="width: 105px">
                                  <dx:ASPxButton ID="btnSalir" runat="server" 
                                      CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" 
                                      CssPostfix="Office2010Blue" onclick="btnSalir_Click" 
                                      SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css" Text="Salir" 
                                      Width="100px">
                                      <Image Url="~/Images/logout.png">
                                      </Image>
                                  </dx:ASPxButton>

                                          </td>
                                          <td>
                                <asp:Label runat="server" Font-Bold="True" ID="lblMensaje"></asp:Label>

                                          </td>
                                      </tr>
                                  </table>
                              </td>
                          </tr>
                      </table>

                                                          <dx:ASPxPivotGrid runat="server" 
                              ClientInstanceName="PivotGrid" Width="100%" ClientIDMode="AutoID" ID="pv" 
                              style="margin-right: 1px" DataSourceID="SqlDataSource1">
                                                              <Fields>
                                                                  <dx:PivotGridField FieldName="cant" ID="fieldcant" Area="DataArea" 
                                                                      AreaIndex="0" UnboundFieldName="fieldcant" Caption="Cantidad" 
                                                                      CellFormat-FormatString="{0:G}" CellFormat-FormatType="Custom" 
                                                                      ValueFormat-FormatString="{0:G}" ValueFormat-FormatType="Custom">
                                                                  </dx:PivotGridField>
                                                                  <dx:PivotGridField FieldName="DES_CLIENTE" ID="fieldDESCLIENTE" Area="RowArea" 
                                                                      AreaIndex="0" Caption="Cliente">
                                                                  </dx:PivotGridField>
                                                                  <dx:PivotGridField FieldName="DES_MODELO" ID="fieldDESMODELO" Area="RowArea" 
                                                                      AreaIndex="1" Caption="Modelo">
                                                                  </dx:PivotGridField>
                                                                  <dx:PivotGridField FieldName="DES_LARGA" ID="fieldDESLARGA" Area="ColumnArea" 
                                                                      AreaIndex="0" Caption="Tipo">
                                                                  </dx:PivotGridField>
                                                                  <dx:PivotGridField FieldName="Ruedas" ID="fieldRuedas" Area="RowArea" 
                                                                      AreaIndex="1" Visible="False" Caption="Ruedas">
                                                                  </dx:PivotGridField>
                                                                  <dx:PivotGridField FieldName="ID" ID="fieldID" Area="RowArea" AreaIndex="2" 
                                                                      Visible="False" Caption="ID">
                                                                  </dx:PivotGridField>
                                                                  <dx:PivotGridField FieldName="DES_COLOR" ID="fieldDESCOLOR" Area="RowArea" 
                                                                      AreaIndex="2" Visible="False" Caption="DES_COLOR">
                                                                  </dx:PivotGridField>
                                                                  <dx:PivotGridField FieldName="COD_HTML" ID="fieldCODHTML" Area="RowArea" 
                                                                      AreaIndex="2" Visible="False" Caption="COD_HTML">
                                                                  </dx:PivotGridField>
                                                                  <dx:PivotGridField FieldName="ID_VENDEDOR" ID="fieldIDVENDEDOR" Area="RowArea" 
                                                                      AreaIndex="1" Visible="False" Caption="ID_VENDEDOR">
                                                                  </dx:PivotGridField>
                                                                  <dx:PivotGridField ID="fieldAnioMes" Area="ColumnArea" AreaIndex="1" 
                                                                      Caption="Mes" FieldName="AnioMes" SortOrder="Descending">
                                                                  </dx:PivotGridField>
                                                              </Fields>
                                                              <OptionsView ShowColumnGrandTotals="False" ShowColumnGrandTotalHeader="False" 
                                                                  ShowRowGrandTotalHeader="False" ShowFilterHeaders="False">
                                                              </OptionsView>
                                                              <OptionsPager Position="Bottom" NumericButtonCount="20" RowsPerPage="15">
                                                              </OptionsPager>
                                                              <OptionsLoadingPanel>
                                                                  <Image Url="~/App_Themes/Office2010Blue/PivotGrid/Loading.gif">
                                                                  </Image>
                                                                  <Style ImageSpacing="5px">
                                                                  </Style>
                                                              </OptionsLoadingPanel>
                                                              <Images SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
                                                                  <CustomizationFieldsBackground Url="~/App_Themes/Office2010Blue/PivotGrid/pcHBack.png">
                                                                  </CustomizationFieldsBackground>
                                                                  <LoadingPanel Url="~/App_Themes/Office2010Blue/PivotGrid/Loading.gif">
                                                                  </LoadingPanel>
                                                              </Images>
                                                              <Styles CssPostfix="Office2010Blue" 
                                                                  CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css">
                                                                  <LoadingPanel ImageSpacing="5px">
                                                                  </LoadingPanel>
                                                                  <CellStyle Cursor="pointer">
                                                                  </CellStyle>
                                                              </Styles>
                                                              <StylesPager>
                                                                  <PageNumber ForeColor="#3E4846">
                                                                  </PageNumber>
                                                                  <Summary ForeColor="#1E395B">
                                                                  </Summary>
                                                              </StylesPager>
                                                              <StylesEditors ButtonEditCellSpacing="0">
                                                              </StylesEditors>
                          </dx:ASPxPivotGrid>



                          <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                              ConnectionString="<%$ ConnectionStrings:DM_CROSLANDConnectionString %>" 
                              ProviderName="<%$ ConnectionStrings:DM_CROSLANDConnectionString.ProviderName %>" 
                              SelectCommand="select * from FU_SELL_IN_OUT_STOCK_REPORTE_INTRANET_SUPERVISOR(@paramAnio,@paramMes,@paramMarca,@paramSupervisor)">
                              <SelectParameters>
                                  <asp:ControlParameter ControlID="cboAño" Name="paramAnio" 
                                      PropertyName="SelectedValue" Type="Int32" />
                                  <asp:ControlParameter ControlID="cboMes" Name="paramMes" 
                                      PropertyName="SelectedValue" Type="String" />
                                  <asp:ControlParameter ControlID="cboMarca" Name="paramMarca" 
                                      PropertyName="SelectedValue" Type="Int32" />
                                  <asp:ControlParameter ControlID="cboSupervisor" Name="paramSupervisor" 
                                      PropertyName="SelectedValue" Type="Int32" />
                              </SelectParameters>
                          </asp:SqlDataSource>



                    <dx:ASPxPopupControl ID="ASPxPopupControl1" runat="server" Height="1px"
        AllowDragging="True" ClientInstanceName="DrillDownWindow" Left="200" Top="200"
        CloseAction="CloseButton" Width="950px" HeaderText="Detalle" 
                          CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" 
                          CssPostfix="Office2010Blue" EnableHotTrack="False" 
                          SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css" 
                              PopupHorizontalAlign="WindowCenter" PopupVerticalAlign="WindowCenter" 
                              AppearAfter="0" Modal="True">
                        <LoadingPanelImage Url="~/App_Themes/Office2010Blue/Web/Loading.gif">
                        </LoadingPanelImage>
                        <HeaderStyle>
                        <Paddings PaddingLeft="7px" />
                        </HeaderStyle>
                        <LoadingPanelStyle ImageSpacing="5px">
                        </LoadingPanelStyle>
        <ContentCollection>
            <dx:PopupControlContentControl ID="PopupControlContentControl1" runat="server">
                <dx:ASPxGridView ID="ASPxGridView1" runat="server" AutoGenerateColumns="False" ClientInstanceName="GridView"
                    OnCustomCallback="ASPxGridView1_CustomCallback" 
                    CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" 
                    CssPostfix="Office2010Blue" Width="100%" 
                    KeyFieldName="ID">
                    <ClientSideEvents EndCallback="function(s, e) { DrillDownWindow.SetSize(0, 100, 100); }" />
                    <Columns>
                        <dx:GridViewDataTextColumn Caption="Tipo" FieldName="DES_LARGA" VisibleIndex="1" 
                            Width="100px" />
                        <dx:GridViewDataTextColumn Caption="Ruedas" FieldName="Ruedas" VisibleIndex="2" 
                            Width="60px" />
                        <dx:GridViewDataDateColumn Caption="Modelo" FieldName="DES_MODELO" VisibleIndex="3" 
                            Width="150px" />
                        <dx:GridViewDataTextColumn Caption="Cantidad" FieldName="cant" 
                            VisibleIndex="6" Width="70px" >
                            <DataItemTemplate>
                                <dx:ASPxSpinEdit ID="seCantidad" runat="server" 
                                    CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" 
                                    CssPostfix="Office2010Blue" Height="21px" Spacing="0" 
                                    SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css" 
                                    Value='<%# Bind("cant") %>' Width="60px">
                                    <SpinButtons HorizontalSpacing="0">
                                    </SpinButtons>
                                    <Paddings PaddingLeft="5px" />
                                </dx:ASPxSpinEdit>
                            </DataItemTemplate>
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Caption="Id" FieldName="ID" 
                            VisibleIndex="5" Visible="False" />
                        <dx:GridViewDataTextColumn Caption="Color" FieldName="DES_COLOR" 
                            ShowInCustomizationForm="True" VisibleIndex="3" Width="100px">
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Caption=" " ShowInCustomizationForm="True" 
                            VisibleIndex="4" Width="35px">
                            <DataItemTemplate>
                                <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                    <tr>
                                        <td style="width: 20px">
                                            <asp:Panel ID="pnColor" runat="server" 
                                                BackColor='<%# System.Drawing.ColorTranslator.FromHtml(Eval("COD_HTML").ToString()) %>' 
                                                Height="15px" Width="15px">
                                            </asp:Panel>
                                        </td>
                                        <td>
                                            <asp:Panel ID="pnColor2" runat="server" 
                                                BackColor='<%# System.Drawing.ColorTranslator.FromHtml(Eval("COD_HTML2").ToString()) %>' 
                                                Height="15px" Width="15px">
                                            </asp:Panel>
                                        </td>
                                    </tr>
                                </table>
                            </DataItemTemplate>
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Caption="Cliente" FieldName="DES_CLIENTE" 
                            ShowInCustomizationForm="True" VisibleIndex="0" Width="200px">
                        </dx:GridViewDataTextColumn>
                    </Columns>
                    <SettingsBehavior AllowDragDrop="False" AllowGroup="False" AllowSort="False" />
                    <SettingsPager Mode="ShowAllRecords">
                    </SettingsPager>
                    <Settings ShowVerticalScrollBar="True" />
                    <SettingsLoadingPanel Text="Cargando..." />
                    <Images SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
                        <LoadingPanelOnStatusBar Url="~/App_Themes/Office2010Blue/GridView/Loading.gif">
                        </LoadingPanelOnStatusBar>
                        <LoadingPanel Url="~/App_Themes/Office2010Blue/GridView/Loading.gif">
                        </LoadingPanel>
                    </Images>
                    <ImagesFilterControl>
                        <LoadingPanel Url="~/App_Themes/Office2010Blue/GridView/Loading.gif">
                        </LoadingPanel>
                    </ImagesFilterControl>
                    <Styles CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" 
                        CssPostfix="Office2010Blue">
                        <Header ImageSpacing="5px" SortingImageSpacing="5px" />
                        <LoadingPanel ImageSpacing="5px">
                        </LoadingPanel>
                    </Styles>
                    <StylesPager>
                        <PageNumber ForeColor="#3E4846">
                        </PageNumber>
                        <Summary ForeColor="#1E395B">
                        </Summary>
                    </StylesPager>
                    <StylesEditors ButtonEditCellSpacing="0">
                        <ProgressBar Height="21px">
                        </ProgressBar>
                    </StylesEditors>
                </dx:ASPxGridView>
                    <table width="100%">
                        <tr>
                            <td align="right">
                                &nbsp;</td>
                            <td align="right" width="105">
                                <dx:ASPxButton ID="btnGrabarDetalle" runat="server" 
                                    CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" 
                                    CssPostfix="Office2010Blue" OnClick="btnGrabarDetalle_Click" 
                                    SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css" Text="Grabar" 
                                    Width="100px">
                                    <Image Url="~/Images/save_16.gif">
                                    </Image>
                                </dx:ASPxButton>
                            </td>
                        </tr>
                </table>
                    </dx:PopupControlContentControl>
        </ContentCollection>
    </dx:ASPxPopupControl>



          <dx:ASPxPopupControl ID="popupErrores" runat="server" AllowDragging="True" 
                    ClientInstanceName="popupErrores" CloseAction="CloseButton" 
                    CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" CssPostfix="Office2010Blue" 
                    EnableViewState="False" HeaderText="Mensaje" Modal="True" 
                    PopupHorizontalAlign="WindowCenter" PopupVerticalAlign="WindowCenter" 
                    SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css" 
              Width="300px" EnableHotTrack="False">
                
                    <HeaderImage Url="~/Images/icon_message.png">
                    </HeaderImage>
                
                    <LoadingPanelImage Url="~/App_Themes/Office2010Blue/Web/Loading.gif">
                    </LoadingPanelImage>
                    <HeaderStyle>
                    <Paddings PaddingLeft="7px" />
                    </HeaderStyle>
                
                    <LoadingPanelStyle ImageSpacing="5px">
                    </LoadingPanelStyle>
                
                 <ContentCollection>
<dx:popupcontrolcontentcontrol ID="PopupControlContentControl2" runat="server" 
                         SupportsDisabledAttribute="True">

    <br />
      <dx:aspxpanel ID="ASPxPanel3" runat="server" DefaultButton="btCreate">
                    <PanelCollection>
                        <dx:panelcontent ID="PanelContent2" runat="server">
                        <table width="100%">
                        <tr>
                        <td align="center" valign="middle">
                        
                        
                        
                            <asp:Label ID="lblMensaje0" runat="server"></asp:Label>
                            <br /> &nbsp;</td>
                        
                        </tr>
                        <tr>
                        <td align="center">
                        
                       
                            <dx:aspxbutton ID="ASPxButton6" runat="server" AutoPostBack="False" 
                                CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" 
                                CssPostfix="Office2010Blue" 
                                SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css" Text="Aceptar" 
                                Width="10px">
                                <ClientSideEvents Click="function(s, e) {
	popupErrores.Hide();
}" />
                                <Image Url="~/Images/ok.png">
                                </Image>
                            </dx:aspxbutton>
                        
                        </td>
                        
                        </tr>
                        
                        
                        </table>




                 </dx:panelcontent>
    </PanelCollection>
   </dx:aspxpanel>
   </dx:popupcontrolcontentcontrol>
</ContentCollection>
                </dx:ASPxPopupControl>



                      </div>


                                  </asp:Content>
